package com.songlanyun.modules.coupon.controller.api;

import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.coupon.service.CouponReceiveRecordService;
import com.songlanyun.modules.coupon.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;


/**
 * 优惠券
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2022-07-05 15:20:02
 */
@RestController
@RequestMapping("api/coupon")
public class CouponApiController extends AbstractApiController {
    @Autowired
    private CouponService couponService;

    /**
     * 可以领取的优惠券
     */
    @RequestMapping("/page")
    //@RequiresPermissions("coupon:couponreceiverecord:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = couponService.canReceivePage(params);
        return R.ok().put("page", page);
    }


}
